package com.wenhuitec.android.tang.ui.pre;

import android.content.Context;
import android.view.Display;
import android.widget.ImageView;
import android.widget.TextView;


import com.lake.banner.uitls.SystemUtils;
import com.wenhuitec.android.tang.R;
import com.wenhuitec.android.tang.ui.activity.BasePresentation;

import cn.bingoogolapple.qrcode.zxing.QRCodeEncoder;

public class BindDevicePre extends BasePresentation {

    ImageView iv_qrcode;

    TextView deviceSn;

    public BindDevicePre(Context outerContext, Display display) {
        super(outerContext, display);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.view_bind_device;
    }

    @Override
    protected void initView() {
        iv_qrcode = findViewById(R.id.iv_qrcode);
        deviceSn = findViewById(R.id.deviceSn);
    }

    @Override
    protected void initData() {

    }

    public void setQr(String str) {
        iv_qrcode.setImageBitmap(QRCodeEncoder.syncEncodeQRCode(str, 300));
        deviceSn.setText("SN: " + SystemUtils.getSerialNumber());
    }


}
